import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class lq99 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int n = scan.nextInt();
        int k = scan.nextInt();
        int[] h = new int[n];
        int[] w = new int[n];
        for (int i = 0; i < n; i++) {
          h[i] = scan.nextInt();
          w[i] = scan.nextInt();
        }
        int maxx = 100000;
        int minn = 1;
        int ave;
        int ans = 0;
        int cut = 0;
        while (minn <= maxx) {
          ave = (maxx + minn) / 2;
          cut = 0;
          for (int i = 0; i < n; i++) {
            cut += ((h[i] / ave) * (w[i] / ave));
          }
          if (cut < k) {
            maxx = ave - 1;
          } else {
            minn = ave + 1;
            ans = ave;
          }
        }
        System.out.println(ans);
        scan.close();
    }
}
